import { Router } from "express";
import { asyncHandler } from "../middleware/asyncHandler";
import svgCaptcha from "svg-captcha"

const router = Router();


router.get( "", (req, res ) => {
    let {data, text} = svgCaptcha.create({
        size: 6,
        ignoreChars: "iIl10oO",
        noise: 6, // 干扰线
        color: true, // 字体颜色
    });
    (req.session as any).captcha = text.toLowerCase()
    res.type("svg")
    res.status(200).send(data)
} )




export default router